package com.example.filedownload;


import java.util.concurrent.atomic.AtomicLong;

public class CacheEntity {
    private static volatile CacheEntity singleTon;
    // 是否在下载
    private static Boolean isDownload = false;
    // 是否下载成功
    private static Boolean isSuccess = false;
    private static long totalSize;
    private static AtomicLong downloadSize=new AtomicLong(0);
    private static String fileUrl;
    private static String tmpFilePath;



    private static String savePath;

    private CacheEntity() {

    }

    public static CacheEntity getSingleTon() {
        if (singleTon == null) {
            synchronized (CacheEntity.class) {
                if (singleTon == null)
                    singleTon = new CacheEntity();
            }
        }
        return singleTon;
    }


    public Boolean getIsDownload() {
        return isDownload;
    }

    public void setIsDownload(Boolean isDownload) {
        CacheEntity.isDownload = isDownload;
    }



    public long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(long totalSize) {
        CacheEntity.totalSize = totalSize;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        CacheEntity.fileUrl = fileUrl;
    }

    public  String getSavePath() {
        return savePath;
    }

    public  void setSavePath(String savePath) {
        CacheEntity.savePath = savePath;
    }

    public  String getTmpFilePath() {
        return tmpFilePath;
    }

    public  void setTmpFilePath(String tmpFilePath) {
        CacheEntity.tmpFilePath = tmpFilePath;
    }

    public  Boolean getIsSuccess() {
        return isSuccess;
    }

    public  void setIsSuccess(Boolean isSuccess) {
        CacheEntity.isSuccess = isSuccess;
    }

    public  AtomicLong getDownloadSize() {
        return downloadSize;
    }

    public  void setDownloadSize(AtomicLong downloadSize) {
        CacheEntity.downloadSize = downloadSize;
    }
}
